// event_arg_and_this.js

const EventEmitter = require('events');

class MyEmitter extends EventEmitter {}

const myEmitter = new MyEmitter();

myEmitter.on('event', function(arg1, arg2) {
    console.log(arg1, arg2, this, this === myEmitter);
});

myEmitter.emit('event', 'a', 'b');

console.log('-'.repeat(10))

myEmitter.on('event2', (arg1, arg2) => {
    console.log(arg1, arg2, this);
})

myEmitter.emit('event2', 'a', 'b');
